<template>
  <div class="formPage commonOutPage">
    <searchContent :searchList="searchList" :submitField="tableData1" @param="getParams" sortType="" contentWidth="60%">
      <div slot="btns">
        <el-button type="primary" plain @click="sear" icon="el-icon-search">查询</el-button>
        <querySetup :tableData="tableData1" @getInputs="fun"></querySetup>
      </div>
    </searchContent>
    <moveDialog :showMoveDialog.sync="show" @confirm="confirm" right="20px" height="860px">
      <searchContent :searchList="tableData1" :submitField="tableData1" @param="getParams" sortType="column"></searchContent>
    </moveDialog>
  </div>
</template>
<script type="text/ecmascript-6">
import moveDialog from './moveDialog'
import querySetup from './querySetup'
import searchContent from './searchContent'
export default {
  name: 'formPage',
  components: {
    moveDialog,
    querySetup,
    searchContent
  },
  data () {
    return {
      searchList: [],
      tableData1: [{
        allowMatchLevels: ['0', '1'],
        allowMatchMode: ['0', '1', '2'],
        controlType: 'RelationBill',
        displayIndex: 1,
        displayText: '产品名称',
        filterFieldId: '124561561231321',
        filterFieldName: 'productName',
        matchLevel: 0,
        matchMode: 0,
        referName: '',
        referType: '',
        visible: 0
      }, {
        allowMatchLevels: ['0'],
        allowMatchMode: ['0', '2'],
        controlType: 'LinkUrl',
        displayIndex: 2,
        displayText: '产品名称2',
        filterFieldId: '124561561231321',
        filterFieldName: 'productName2',
        matchLevel: 0,
        matchMode: 0,
        referName: '',
        referType: '',
        visible: 0
      }, {
        allowMatchLevels: ['1'],
        allowMatchMode: ['1', '2'],
        controlType: 'NText',
        displayIndex: 3,
        displayText: '产品名称3',
        filterFieldId: '124561561231321',
        filterFieldName: 'productName3',
        matchLevel: 0,
        matchMode: 0,
        referName: '',
        referType: '',
        visible: 0
      }, {
        allowMatchLevels: ['0'],
        allowMatchMode: ['1', '0'],
        controlType: 'DateTime',
        displayIndex: 4,
        displayText: '产品名称4',
        filterFieldId: '124561561231321',
        filterFieldName: 'productName4',
        matchLevel: 0,
        matchMode: 0,
        referName: '',
        referType: '',
        visible: 0
      }],
      show: false,
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      }
    }
  },
  methods: {
    getParams (val) {
      this.params = val
    },
    sear () {
      this.show = true
      console.log(this.params)
    },
    fun (list) {
      this.searchList = list
    },
    confirm () {
      this.show = false
      console.log(this.form)
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
